New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ahooksjs/use-request

Package Overview
Dependencies
Maintainers
5
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ahooksjs/use-request

React Hooks for fetching, caching and updating asynchronous data

2.8.15
latest
Source
npm
Version published
Weekly downloads
32K
-3.74%
Maintainers
5
Weekly downloads
 
Created
Source

useRequest

Production-ready React Hook to manage asynchronous data.

Core Characteristics

  • Auto-triggered request and Manually-triggered Request
  • SWR(stale-while-revalidate)
  • Cache / Preload
  • Refresh On Window Focus
  • Polling
  • Debounce
  • Throttle
  • Concurrent Request
  • Dependent Request
  • Loading Delay
  • Pagination
  • Load more, data recovery and scroll position recovery
  • ......

Installing

Inside your React project directory, run the following:

yarn add @ahooksjs/use-request

yarn add @ahooksjs/use-request

Or with npm:

npm install @ahooksjs/use-request

Example

import useRequest from '@ahooksjs/use-request';

const { data, error, loading, run } = useRequest('/api/user');

Documentation

https://ahooks.js.org/hooks/async

FAQs

Package last updated on 07 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts